package org.fanpeng.demo.design;

/**
 * className: Singleton_00
 * Description:
 * date: 2021/8/4 11:13
 *
 * @author fanpeng
 * @version 1.0
 */
public class Singleton_05 {
    // 双重锁校验(线程安全)
    private static Singleton_05 instance;

    private Singleton_05(){
    }

    public static Singleton_05 getInstance() {
        if (null != instance){
            return instance;
        }
        synchronized (Singleton_05.class){
            if (null == instance) {
                instance = new Singleton_05();
            }
        }
        return instance;
    }
}
